module;

export module Code_19_2_2;


template<typename T1, typename T2>
class SumPolicy 
{
public:
    static void accumulate(T1& total, T2 const& value) 
    {
        total += value;
    }
};

template<typename T,
         template<typename, typename> class Policy = SumPolicy,
         typename Traits = AccumulationTraits<T>>
auto accum(T const* beg, T const* end)
{
    using AccT = typename Traits::AccT;
    AccT total = Traits::zero();
    while (beg != end) 
    {
        Policy<AccT, T>::accumulate(total, *beg);
        ++beg;
    }
    return total;
}

export
namespace Code_19_2_2 {

    void run()
    {

    }
}
